<?php
include_once('common/header.php');	
if($AppUI->id <= 0) {
	$this->_redirect(HOST_VFRIEND);
}
$intType	= $objRequest->getParam('type', 0);
$strView	= $objRequest->getParam('view', '');
$strEdit	= $objRequest->getParam('edit', '');
if($intType > 0) {
	$objView 		= Zend_Registry::get('objView');
	$objVfriendUser = new Vfriend_User();
	$objUser		= $objVfriendUser->getFull($AppUI->id);
	$this->view->objUser = $objUser;
	$this->view->strView = $strView;
	$this->view->strEdit = $strEdit;
	$this->view->intType = $intType;
	switch($intType) {
		case 1:
			$strForm = $objView->fetch('account/box-email.tpl');
			break;
		case 2:
			$strForm = $objView->fetch('account/box-password.tpl');
			break;
		case 3:
			$strForm = $objView->fetch('account/box-mobile.tpl');
			break;
		case 4:
			$strForm = $objView->fetch('account/box-fullhouse.tpl');
			break;
		case 5:
			$strForm = $objView->fetch('account/box-fullname.tpl');
			break;
		case 6:
			$objCommon 				 	= new Vfriend_Common();
			$this->view->arrCountry  	= $objCommon->getCountry();
			$this->view->arrProvince 	= $objCommon->getProvince($objUser->country);
			$this->view->arrDistrict  	= $objCommon->getDistrict($objUser->province);
			$strForm = $objView->fetch('account/box-addr.tpl');
			break;
		case 7:
			$strForm = $objView->fetch('account/box-introduce.tpl');
			break;
		case 8:
			$strForm = $objView->fetch('account/box-personality.tpl');
			break;
		case 9:
			$objCommon 				 = new Vfriend_Common();			
			$this->view->arrReligion = $objCommon->getReligion($AppUI->id);
			$strForm = $objView->fetch('account/box-religion.tpl');
			break;
		case 10:
			$objCommon 				  = new Vfriend_Common();			
			$this->view->arrEducation = $objCommon->getEducation($AppUI->id);
			$strForm = $objView->fetch('account/box-education.tpl');
			break;
		case 11:
			$objCommon 				   = new Vfriend_Common();			
			$this->view->arrOccupation = $objCommon->getOccupation($AppUI->id);
			$strForm = $objView->fetch('account/box-occupation.tpl');
			break;
		case 12:
			$objCommon 				 = new Vfriend_Common();			
			$this->view->arrPosition = $objCommon->getPosition($AppUI->id);
			$strForm = $objView->fetch('account/box-position.tpl');
			break;
		case 13:
			$objCommon 				= new Vfriend_Common();			
			$this->view->arrMarital = $objCommon->getMarital($AppUI->id);
			$strForm = $objView->fetch('account/box-marital.tpl');
			break;
		case 14:
			$strForm = $objView->fetch('account/box-bmi.tpl');
			break;
		case 15:
			$intWidth	 = AVATAR_IMAGE_FULL_WIDTH;
			$intHeight	 = AVATAR_IMAGE_FULL_HEIGHT;
			$srcFileName = DIR_AVATAR_FULL . $objUser->image_path;
			list( $intWidth, $intHeight) = getimagesize( $srcFileName );
			$this->view->intHeight	= $intHeight;
			$strForm = $objView->fetch('account/box-avatar.tpl');
			break;
		default:
			break;
	}
}
else {
	$strForm = 'Loading error';
}
$arrJson = array('form'=>$strForm);
echo $objRequest->getParam('callback') . '(' . Zend_Json::encode($arrJson) . ')';
exit();
?>